package com.cjm.one.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cjm.one.common.result.Result;
import com.cjm.one.custom.client.CustomerAddressClient;
import com.cjm.one.model.custom.entity.CustomAddress;
import com.cjm.one.service.CustomerAddressService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class CustomerAddressServiceImpl implements CustomerAddressService {
    @Resource
    private CustomerAddressClient customerAddressClient;
    @Override
    public Result<Page<CustomAddress>>list(Integer current, Integer size) {
        return customerAddressClient.list(current, size);

    }

    @Override
    public Result<Boolean> add(CustomAddress customAddress) {
        return customerAddressClient.add(customAddress);

    }

    @Override
    public Result<Boolean> delete(Long id) {
        return customerAddressClient.delete(id);

    }

    @Override
    public Result<Boolean> update(CustomAddress customAddress) {
        return customerAddressClient.update(customAddress);

    }

    @Override
    public Result<CustomAddress> getById(Long id) {
        return customerAddressClient.getAddressInfo(id);
    }

    @Override
    public Result<CustomAddress> getAddressDefaultInfo() {
        return  customerAddressClient.getAddressDefaultInfo();
    }
}
